home *** CD-ROM | disk | FTP | other *** search
/ The Business Master (3rd Edition) / The Business Master (3rd Edition).iso / files / utilstem / dosutil2 / xtmenu.bas < prev   
BASIC Source File  |  1977-02-05  |  9KB  |  195 lines

  1. 10 ' ********** PGM     : XTMENU -  UTILITIES              **********
  2. 20 ' ********** AUTHOR  : DAVE ARMBRUSTER   SEPTEMBER 1984 **********
  3. 30 ' ********** VERSION : 1.2                              **********
  4. 40 '
  5. 50 SELECT = 6  'ENTER NUMBER OF SUBDIRECTORY APPLICATIONS HERE
  6. 60 KEY OFF:CLS:GOSUB 1020
  7. 70 CLS:COLOR 6,0,0
  8. 80 LOCATE 1,1,0:PRINT "   -----------------------------  ";:COLOR 7,0,0:PRINT"PRIMARY MENU";:COLOR 6,0,0:PRINT"  -----------------------------   "
  9. 90 DAY$=DATE$:COLOR 6,0,0:LOCATE 2,61,0:PRINT"DATE : ";:COLOR 0,7,0:PRINT DAY$
  10. 100 TIM$=TIME$:COLOR 6,0,0:LOCATE 4,61,0:PRINT"TIME : ";:COLOR 0,7,0:PRINT TIM$
  11. 110 COLOR 6,0,0:LOCATE 6,12,0:PRINT "F1  APPLICATION  - Select library foreground job"
  12. 120 LOCATE 7,12,0:PRINT "F2  UTILITY      - PC Utilities"
  13. 130 LOCATE 8,12,0:PRINT "F3  BASICA       - Exit to Basic Programming Language"
  14. 140 LOCATE 9,12,0:PRINT "F4  MESSAGE      - Post System Message"
  15. 150 LOCATE 10,12,0:PRINT "F5  SYSTEM       - Exit to Disk Operating System"
  16. 160 COLOR 7,0,0:LOCATE 2,4,0:PRINT"OPTION ===>>"
  17. 170 COLOR 0,7,0:SEL$=""
  18. 180 WHILE SEL$<>"1" AND SEL$<>"2" AND SEL$<>"3" AND SEL$<>"4" AND SEL$<>"5"
  19. 190 TIM$=TIME$:LOCATE 4,68,0:PRINT TIM$
  20. 200 POKE 106,0
  21. 210 SEL$=INKEY$
  22. 220 WEND:COLOR 7,0,0
  23. 230 IF SEL$="X" OR SEL$="x" THEN CLS:SYSTEM
  24. 240 X=VAL(SEL$):LOCATE 2,16,0:PRINT X
  25. 250 FOR I=1 TO 500:NEXT I
  26. 260 IF X=5 THEN CLS:SYSTEM
  27. 270 ON X GOTO 350,920,290,580
  28. 280 '
  29. 290 ' ========== SETUP PROGRAMMING ENVIRONMENT ==========
  30. 300 '
  31. 310 KEY 1,"LIST":KEY 2,"RUN":KEY 3,"CLS":KEY 4,"FILES"+CHR$(13):KEY 5,"LOCATE ":KEY 6,"COLOR "
  32. 320 KEY 7,"SYSTEM"+CHR$(13):KEY 8,"TRON":KEY 9,"TROFF":KEY 10,"KEY"
  33. 330 KEY ON:COLOR 6,0,0:CLS:NEW
  34. 340 '
  35. 350 ' ========== APPLICATION MENU ==========
  36. 360 '
  37. 370 CLS:COLOR 6,0,0
  38. 380 LOCATE 1,1,0:PRINT "   ----------------------------  ";:COLOR 7,0,0:PRINT"APPLICATION MENU";:COLOR 6,0,0:PRINT"  ----------------------------"
  39. 390 DAY$=DATE$:COLOR 6,0,0:LOCATE 2,61,0:PRINT"DATE : ";:COLOR 0,7,0:PRINT DAY$
  40. 400 TIM$=TIME$:COLOR 6,0,0:LOCATE 4,61,0:PRINT"TIME : ";:COLOR 0,7,0:PRINT TIM$
  41. 410 COLOR 6,0,0
  42. 420 FOR I=6 TO 12:LOCATE I,12,0:PRINT OPT$(I-5):NEXT I
  43. 430 COLOR 7,0,0:LOCATE 2,4,0:PRINT"PRESS OPTION LETTER ===>>"
  44. 440 COLOR 0,7,0:S$="":X=999
  45. 450 WHILE S$<>"1" AND S$<>"2" AND S$<>"3" AND S$<>"4" AND S$<>"5" AND S$<>"6" AND S$<>"7"
  46. 460 TIM$=TIME$:LOCATE 4,68,0:PRINT TIM$
  47. 470 POKE 106,0
  48. 480 S$=INKEY$
  49. 490 WEND:COLOR 7,0,0
  50. 500 IF S$="M" OR S$="m" THEN 70
  51. 510 X=VAL(S$):LOCATE 2,30,0:PRINT X
  52. 520 IF X=7 THEN 70
  53. 530 FOR I=1 TO SELECT
  54. 540 IF X=I THEN CHDIR DIR$+PATH$(I)
  55. 550 NEXT I
  56. 560 CLS:SYSTEM
  57. 570 '
  58. 580 ' ========== MESSAGE ROUTINE ==========
  59. 590 '
  60. 600 COLOR 6,0,0:CTR=8:CLS:LOCATE 1,1,0:PRINT "   ----------------------------  ";:COLOR 7,0,0:PRINT"BULLETIN BOARD";:COLOR 6,0,0:PRINT"  ----------------------------   ":COLOR 7,0,0
  61. 610 LOCATE 3,16,0:PRINT"F1 ==> READ     F2 ==> APPEND     F3 ==> CREATE"
  62. 620 COLOR 6,0,0:LOCATE 7,1,0:PRINT"....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+...."
  63. 630 Q$="":WHILE Q$<>"1" AND Q$<>"2" AND Q$<>"3"
  64. 640 POKE 106,0
  65. 650 Q$=INKEY$
  66. 660 WEND:T=VAL(Q$):IF T=1 THEN 670 ELSE IF T=2 THEN 680 ELSE 690
  67. 670 OPEN "BULLETIN.XTM" FOR INPUT AS #1:GOTO 710
  68. 680 OPEN "BULLETIN.XTM" FOR APPEND AS #1:COLOR 7,0,0:GOTO 790
  69. 690 OPEN "BULLETIN.XTM" FOR OUTPUT AS #1:COLOR 7,0,0:GOTO 790
  70. 700 FOR I=8 TO 23:LOCATE I,1,0:PRINT R$:NEXT I
  71. 710 IF EOF(1) THEN CLOSE:GOTO 760
  72. 720 LINE INPUT #1,H$
  73. 730 LOCATE CTR,1,0:PRINT H$
  74. 740 CTR=CTR+1:IF CTR<21 THEN 710 ELSE CTR=8
  75. 750 LOCATE 23,53,0:INPUT"......<ENTER) to continue";ANS$:GOTO 700
  76. 760 LOCATE 23,40,0:INPUT"MESSAGE COMPLETE.....<ENTER> when ready";ANS$
  77. 770 COLOR 7,0,0:GOTO 70
  78. 780 '
  79. 790 ' ============= MESSAGE INPUT ==========
  80. 800 '
  81. 810 LOCATE 5,58,0:PRINT"Input begins, enter 'DONE' to end":GOTO 830
  82. 820 FOR I=8 TO 23:LOCATE I,1,0:PRINT R$:NEXT I
  83. 830 LOCATE CTR,1,0:INPUT"",H$
  84. 840 IF H$="DONE" OR H$="done" THEN CLOSE:GOTO 890
  85. 850 LENGTH=LEN(H$):IF LENGTH>80 THEN 830
  86. 860 PRINT#1,H$
  87. 870 CTR=CTR+1:IF CTR>=23 THEN CTR=8:GOTO 820
  88. 880 GOTO 830
  89. 890 LOCATE 23,26,0:PRINT"DATA ENTRY COMPLETE........."
  90. 900 FOR I=1 TO 2500:NEXT I
  91. 910 COLOR 7,0,0:GOTO 70
  92. 920 ' ========== INSERT UTILITIES HERE ==========
  93. 930 ' =                                         =
  94. 940 ' =                                         =
  95. 950 ' =                                         =
  96. 960 ' =                                         =
  97. 970 ' =                                         =
  98. 980 ' =                                         =
  99. 990 ' ===========================================
  100. 1000 GOTO 70
  101. 1010 '
  102. 1020 ' ========== SET SYSTEM PARMETERS ==========
  103. 1030 '
  104. 1040 DIM PATH$(SELECT):FOR I=1 TO SELECT:READ PATH$(I):NEXT I
  105. 1050 DIM OPT$(SELECT+1):FOR I=1 TO SELECT+1:READ OPT$(I):NEXT I
  106. 1060 FOR I=1 TO 10:Z$=RIGHT$(STR$(I),1):KEY I,Z$:NEXT I
  107. 1070 R$=SPACE$(78)
  108. 1080 DIR$="C:\MASTER\"  'SELECT DIRECTORY LEVELS
  109. 1090 DATA "ISPF","PASCAL","DBASE","GAMES","LOTUS","PCTALK"
  110. 1100 DATA " F1   ISPF  - Exit to Screen Productivity Facility"
  111. 1110 DATA " F2   PAS   - Pascal compiler subsystem"
  112. 1120 DATA " F3   DB    - Exit to DBASE macro language"
  113. 1130 DATA " F4   GMS   - Select GMS menu option"
  114. 1140 DATA " F5   123   - Lotus 1-2-3 spreadsheet"
  115. 1150 DATA " F6   PCT   - Begin PCTALK III communications"
  116. 1160 DATA " F7         - Exit to Menu"
  117. 1170 RETURN
  118. 1500 '
  119. 1510 '
  120. 1520 '*****************************************************************
  121. 1530 '
  122. 1540 '     This program acts as an applications control and utility
  123. 1550 ' menu. To use it in its current form you should have DOS 2.0
  124. 1560 ' or a higher release. It works by utilizing the directory
  125. 1570 ' capabilities in BASICA and a series of batch files. I use a
  126. 1580 ' program called MENU.BAT to start things rolling. This file
  127. 1590 ' is as follows :
  128. 1600 '
  129. 1610 ' echo off            <<=== turn off the echo function
  130. 1620 ' cls                 <<=== clear screen
  131. 1630 ' basica xtmenu.bas   <<=== execute the primary menu
  132. 1640 ' xtm.bat             <<=== execute application batch file in
  133. 1650 '                           directory ???
  134. 1660 '
  135. 1670 '     Each application must have its own subdirectory and files.
  136. 1675 ' The XTMENU file uses the root directory which must contain
  137. 1680 ' BASICA.COM. For instance if you are using PC-Talk then all
  138. 1690 ' of the associated files for it should be in one directory called
  139. 1700 ' PCTALK or whatever. When the program is run it changes the
  140. 1710 ' current directory using the CHDIR command and then returns
  141. 1720 ' control to the system. As shown above the system then
  142. 1730 ' executes the XTM.BAT file. The XTM.BAT file resides in each
  143. 1740 ' application directory so DOS doesnt fuss too much. A sample XTM
  144. 1750 ' file looks like this :
  145. 1760 '
  146. 1770 ' cls                 <<=== clear screen
  147. 1780 ' pc-talk.exe         <<=== execute any application
  148. 1790 ' cd\                 <<=== change to root directory
  149. 1800 ' xtmenu.bat          <<=== rerun the menu program
  150. 1810 '
  151. 1820 '     A XTM.BAT file must also reside in the root directory with
  152. 1830 ' the XTMENU file. Mine does the following on menu termination :
  153. 1840 '
  154. 1850 ' cls
  155. 1860 ' dir *.ba?
  156. 1870 '
  157. 1873 ' =====>> SETUP
  158. 1877 '
  159. 1880 '     The file MESSAGE.XTM should also be in the root directory.
  160. 1890 ' Use the CREATE option to place one there in your initial setup.
  161. 1900 '
  162. 1910 ' LINE   50 - Change the variable 'SELECT' to the number of
  163. 1920 '             applications you wish to use (UP TO 10).
  164. 1930 '
  165. 1940 ' LINE  450 - Change this to the number of selection you like plus
  166. 1950 '             one to exit back to the menu. This line could be
  167. 1960 '             changed to a loop but I leave that for you.
  168. 1970 '
  169. 1980 ' LINE  920 - The utilities I use are the Norton Utilities which
  170. 1990 '             I execute with the SHELL command in DOS 3.0. Since
  171. 2000 '             most people do not yet have this release I have
  172. 2010 '             omitted these routines to let somebody add their
  173. 2020 '             own favorites.
  174. 2030 '
  175. 2040 ' LINE 1080 - The variable DIR$ should be changed to your system
  176. 2050 '             needs. It provides the path to the application
  177. 2060 '             directories you need. All Applications should be on
  178. 2070 '             the same level . If they are not then use line
  179. 2080 '             1090 to make corrections to the proper path.
  180. 2090 '
  181. 2100 ' LINE 1090 - This line contains the names of the directories
  182. 2110 '             to be accessed for each application and should
  183. 2120 '             be changed to your system needs.
  184. 2130 '
  185. 2140 ' LINE 1100 - This group of lines is displayed for the application
  186. 2150 '             menu.
  187. 2160 '
  188. 2170 '      This program should be changed to your own needs and
  189. 2180 ' could be enhanced quite a bit. If you do have problems with
  190. 2190 ' it then leave a message on the bulletin board.
  191. 2200 '
  192. 2210 '                                     Dave Armbruster
  193. 2220 '
  194. 2230 '*****************************************************************
  195.